<html>
<body>
Reports local variable declarations and accessors to record components that can be replaced with pattern variables in enhanced `for` statements, which are usually more compact.
<p><b>Example:</b></p>
<pre><code>
record Record(Integer x, String y) {
}

public static void test(List&lt;Record&gt; records) {
    for (Record record : records) {
        System.out.println(record.y());
        Integer x = record.x;
        System.out.println(x);
    }
}
</code></pre>
<p>Can be replaced with:</p>
<pre><code>
record Record(Integer x, String y) {
}

public static void test(List&lt;Record&gt; records) {
    for (Record(Integer x, String y) : records) {
        System.out.println(y);
        System.out.println(x);
    }
}
</code></pre>
<!-- tooltip end -->
<ul>
  <li>Use the <b>Nesting depth limit</b> option to specify the maximum number of nested deconstruction patterns to report</li>
  <li>Use the <b>Maximum number of record components to deconstruct</b> option to specify the maximum number of components, which a record can contain to be used in deconstruction patterns</li>
  <li>Use the <b>Maximum number of not-used record components</b> option to specify the maximum number of components, which are not used in <code>for</code> statement</li>
</ul>

<p><small>New in 2023.1</small></p>
</body>
</html>